﻿using BLL;
using IBLL;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using 考试管理系统;

namespace WindowsFormsApp1
{
    public partial class FrScoreAdd : Form
    {
        IFrExamManage_IBLL frExam = new FrExamManage_BLL();
        public FrScoreAdd()
        {
            InitializeComponent();
            uiDataGridView1.DataSource= frExam.SubMit_info("	select 编号=PapersNumber,名称=PapersName,开始时间=TestStartTime,持续时间=TestDuration,考试地点=ClassName,课目=CourseName from view_2").Tables[0];
        }

        private void button2_Click(object sender, EventArgs e)
        {
           
        }

        private void uiDataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (uiDataGridView1.SelectedRows.Count < 0 || e.RowIndex < 0)
            {
                return;
            }
            uiDataGridView1.Rows[e.RowIndex].Selected = true;
            if (uiDataGridView1.SelectedRows.Count != 1)
            {
                return;
            }
           Score score = new Score(uiDataGridView1.SelectedRows[0].Cells[0].Value.ToString());
            score.Show();
        }

        private void uiDataGridView1_CellMouseClick(object sender, DataGridViewCellMouseEventArgs e)
        {
            if (uiDataGridView1.SelectedRows.Count < 0 || e.RowIndex < 0)
            {
                return;
            }
           
            uiDataGridView1.Rows[e.RowIndex].Selected = true;
        }
    }
}
